home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / PowerMacInterface / windows.icl < prev   
Encoding:
Modula Implementation  |  1996-03-01  |  4.8 KB  |  162 lines  |  [TEXT/3PRM]

  1. implementation module windows;
  2.  
  3. import mac_types;
  4.  
  5. InDesk :== 0;
  6. InMenuBar :== 1;
  7. InSysWindow :== 2;
  8. InContent :== 3;
  9. InDrag :== 4;
  10. InGrow :== 5;
  11. InGoAway :== 6;
  12. InZoomIn :== 7;
  13. InZoomOut :== 8;
  14.  
  15. //    Initialization and Allocation
  16.  
  17. NewWindow :: !Ptr !Rect !{#Char} !Bool !Int !WindowPtr !Bool !Int !Toolbox -> (!WindowPtr,!Toolbox);
  18. NewWindow wStorage (left,top,right,bottom) title visible procID behind goAwayFlag refCon t
  19. = code (right=W,bottom=W,left=W,top=W,wStorage=D0,title=O0D1SD2,visible=D3,
  20.           procID=D4,behind=D5,goAwayFlag=D6,refCon=D7,t=U) (window_pointer=D0,z=I8Z)
  21. {
  22.     instruction    0x7CC600D0    |    neg    r6,r6
  23.     instruction    0x7D2900D0    |    neg    r9,r9
  24.     call    .NewWindow
  25. };
  26.  
  27. NewCWindow :: !Ptr !Rect !{#Char} !Bool !Int !WindowPtr !Bool !Int !Toolbox -> (!WindowPtr,!Toolbox);
  28. NewCWindow wStorage (left,top,right,bottom) title visible procID behind goAwayFlag refCon t
  29. = code (right=W,bottom=W,left=W,top=W,wStorage=D0,title=O0D1SD2,visible=D3,
  30.           procID=D4,behind=D5,goAwayFlag=D6,refCon=D7,t=U)(window_pointer=D0,z=I8Z)
  31. {
  32.     instruction    0x7CC600D0    |    neg    r6,r6
  33.     instruction    0x7D2900D0    |    neg    r9,r9
  34.     call    .NewCWindow
  35. };
  36.  
  37. DisposeWindow :: !WindowPtr !Toolbox -> Toolbox;
  38. DisposeWindow theWindow t = code (theWindow=D0,t=U)(z=Z){
  39.     call    .DisposeWindow
  40. };
  41.  
  42. //    Window Display
  43.  
  44. SetWTitle :: !WindowPtr !{#Char} !Toolbox -> Toolbox;
  45. SetWTitle theWindow title t = code (theWindow=D0,title=SD1,t=U)(z=Z){
  46.     call    .SetWTitle
  47. };
  48.  
  49. SelectWindow :: !WindowPtr !Toolbox -> Toolbox;
  50. SelectWindow theWindow t = code (theWindow=D0,t=U)(z=Z){
  51.     call    .SelectWindow
  52. };
  53.  
  54. HideWindow :: !WindowPtr !Toolbox -> Toolbox;
  55. HideWindow theWindow t = code (theWindow=D0,t=U)(z=Z){
  56.     call        .HideWindow
  57. };
  58.  
  59. ShowWindow :: !WindowPtr !Toolbox -> Toolbox;
  60. ShowWindow theWindow t = code (theWindow=D0,t=U)(z=Z){
  61.     call    .ShowWindow
  62. };
  63.  
  64. ShowHide :: !WindowPtr !Bool !Toolbox -> Toolbox;
  65. ShowHide theWindow showFlag t = code (theWindow=D0,showFlag=D1,t=U)(z=Z){
  66.     call    .ShowHide
  67. };
  68.  
  69. SendBehind :: !WindowPtr !WindowPtr !Toolbox -> Toolbox;
  70. SendBehind theWindow behindWindow t = code (theWindow=D0,behindWindow=D1,t=U)(z=Z){
  71.     call    .SendBehind
  72. };
  73.  
  74. DrawGrowIcon :: !WindowPtr !Toolbox -> Toolbox;
  75. DrawGrowIcon theWindow t = code (theWindow=D0,t=U)(z=Z){
  76.     call    .DrawGrowIcon
  77. };
  78.  
  79. FrontWindow :: !Toolbox -> (!WindowPtr,!Toolbox);
  80. FrontWindow t = code (t=U)(theWindow=D0,z=Z){
  81.     call    .FrontWindow
  82. };
  83.  
  84. //    Mouse Location
  85.  
  86. FindWindow :: !Int !Int !Toolbox -> (!Int,!WindowPtr,!Toolbox);
  87. FindWindow h v t = code (h=R4D0,v=a0,t=O0D1U)(wher=D0,whichWindow=L,z=Z){
  88.     instruction 0x52E3801E    |    rlwimi    r3,r23,16,0,15
  89.     call    .FindWindow
  90. };
  91.  
  92. TrackGoAway :: !WindowPtr !Int !Int !Toolbox -> (!Bool,!Toolbox);
  93. TrackGoAway theWindow h v t = code (theWindow=D0,h=D1,v=A0,t=U)(result=D0,z=Z){
  94.     instruction 0x52E4801E    |    rlwimi    r4,r23,16,0,15
  95.     call    .TrackGoAway
  96.     instruction    0x70630001    |    andi.    r3,r3,1
  97.     instruction    0x7C6300D0    |    neg    r3,r3
  98. };
  99.  
  100. TrackBox :: !WindowPtr !Int !Int !Int !Toolbox -> (!Bool,!Toolbox);
  101. TrackBox theWindow h v partCode t = code (theWindow=D0,h=D1,v=A0,partCode=D2,t=U)(result=D0,z=Z){
  102.     instruction 0x52E4801E    |    rlwimi    r4,r23,16,0,15
  103.     call    .TrackBox
  104.     instruction    0x70630001    |    andi.    r3,r3,1
  105.     instruction    0x7C6300D0    |    neg    r3,r3
  106. };
  107.  
  108. //    Window Movement and Sizing
  109.  
  110. MoveWindow :: !WindowPtr !Int !Int !Bool !Toolbox -> Toolbox;
  111. MoveWindow theWindow hGlobal vGlobal front t = code (theWindow=D0,hGlobal=D1,vGlobal=D2,front=D3,t=U)(z=Z){
  112.     call    .MoveWindow
  113. };
  114.  
  115. DragWindow :: !WindowPtr !Int !Int !Rect !Toolbox -> Toolbox;
  116. DragWindow theWindow h v (left,top,right,bottom) t
  117. = code (right=W,bottom=W,left=W,top=W,theWindow=D0,h=D1,v=A0,t=O0D2U)(z=I8Z){
  118.     instruction 0x52E4801E    | rlwimi    r4,r23,16,0,15
  119.     call    .DragWindow
  120. };
  121.  
  122. GrowWindow :: !WindowPtr !Int !Int !Rect !Toolbox -> (!(!Int,!Int),!Toolbox);
  123. GrowWindow theWindow h v (left,top,right,bottom) t
  124. = code (right=W,bottom=W,left=W,top=W,theWindow=D0,h=D1,v=A0,t=O0D2U)(h2=D0,w2=D1,z=I8Z){
  125.     instruction 0x52E4801E    | rlwimi    r4,r23,16,0,15
  126.     call    .GrowWindow
  127.     instruction    0x5464843E    | srwi    r4,r3,16
  128.     instruction 0x7063FFFF    | andi.    r3,r3,65535
  129. };
  130.  
  131. SizeWindow :: !WindowPtr !Int !Int !Bool !Toolbox -> Toolbox;
  132. SizeWindow theWindow w h fUpdate t = code (theWindow=D0,w=D1,h=D2,fUpdate=D3,t=U)(z=Z){
  133.     call    .SizeWindow
  134. };
  135.  
  136. ZoomWindow :: !WindowPtr !Int !Bool !Toolbox -> Toolbox;
  137. ZoomWindow theWindow partCode front t = code (theWindow=D0,partCode=D1,front=D2,t=U)(z=Z){
  138.     call    .ZoomWindow
  139. };
  140.  
  141. //    Update Region Maintenance
  142.  
  143. InvalRect :: !Rect !Toolbox -> Toolbox;
  144. InvalRect (left,top,right,bottom) t = code (right=W,bottom=W,left=W,top=W,t=O0D0U)(z=I8Z){
  145.     call    .InvalRect
  146. };
  147.  
  148. ValidRect :: !Rect !Toolbox -> Toolbox;
  149. ValidRect (left,top,right,bottom) t = code (right=W,bottom=W,left=W,top=W,t=O0D0U)(z=I8Z){
  150.     call    .ValidRect
  151. };
  152.  
  153. BeginUpdate :: !WindowPtr !Toolbox -> Toolbox;
  154. BeginUpdate theWindow t = code (theWindow=D0,t=U)(z=Z){
  155.     call    .BeginUpdate
  156. };
  157.  
  158. EndUpdate :: !WindowPtr !Toolbox -> Toolbox;
  159. EndUpdate theWindow t = code (theWindow=D0,t=U)(z=Z){
  160.     call    .EndUpdate
  161. };
  162.